package service

import (
	"context"
	"strconv"
	__ "video-srv/basic/pro"
	"video-srv/model"
)

type Server struct {
	__.UnimplementedVideoServer
}

// SayHello implements helloworld.GreeterServer
func (s *Server) VideoAdd(_ context.Context, in *__.VideoAddReq) (*__.VideoAddResp, error) {

	video := model.Video{

		Title:     in.Title,
		Class:     in.Class,
		Label:     in.Label,
		Image_Url: in.ImageUrl,
	}

	return &__.VideoAddResp{
		VideoId: strconv.Itoa(int(video.ID)),
	}, nil
}
